package com.fuxi.cloud.desreport.b;

import freemarker.cache.StringTemplateLoader;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;

import java.io.IOException;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * a
 *
 * @Author: 扫地僧
 * @CreateTime: 2021-05-03
 */
public class g {
    public g() {
    }

    public static String a(String var0, String var1, Object var2) throws IOException, TemplateException {
        Configuration var3 = getConfiguration();
        Template var4 = new Template(var0, var1, var3);
        StringWriter var5 = new StringWriter();
        var4.process(var2, var5);
        return var5.toString();
    }

    public static void a(Map<String, Object> var0) {
        ArrayList var1 = new ArrayList();
        HashMap var2 = new HashMap();
        var2.put("name", "张三");
        var2.put("age", "12");
        var1.add(var2);
        HashMap var3 = new HashMap();
        var3.put("name", "李四");
        var3.put("age", "23");
        var1.add(var3);
        HashMap var4 = new HashMap();
        var4.put("name", "王五");
        var4.put("age", "16");
        var1.add(var4);
        HashMap var5 = new HashMap();
        var5.put("name", "赵大");
        var5.put("age", "33");
        var1.add(var5);
        HashMap var6 = new HashMap();
        var6.put("name", "钱九");
        var6.put("age", "55");
        var1.add(var6);
        var0.put("list", var1);
    }

    private static Configuration getConfiguration() {
        Configuration var0 = new Configuration(Configuration.VERSION_2_3_28);
        StringTemplateLoader var1 = new StringTemplateLoader();
        var0.setTemplateLoader(var1);
        var0.setDefaultEncoding("UTF-8");
        return var0;
    }
}
